dim doc
set doc=application.activedocument
dim curlyr
dim layercount
curlyr = doc.activelayer
layercount= doc.ElectricalLayerCount 
curlyr = curlyr+1
if curlyr>layercount then
	curlyr =1
end if

dim ws : set ws = CreateObject("WScript.Shell")
dim varName : varName = "ActiveLayerOnly"
dim regPath : regPath ="HKEY_CURRENT_USER\Software\MyApp\PADS\" & varName
dim varValue : varValue = ws.RegRead(regPath)
Application.StatusBarText =""
select case varValue
	case 0 'multilayer
		application.modelesscmd("z " & curlyr)		
	case 1
		application.modelesscmd("l " & curlyr)	
end select
set ws = nothing
Application.StatusBarText = "ActiveLayer = " & curlyr